Robotics 1.0 Lesson Plan
Lesson 8 - Serve It Cool
1 class (Duration: 1 hour 30 minutes; maximum 4 students per group).
Desktop or laptop computer, CPX board, USB cable
Micro Servo 9g
Adafruit Circuit Playground Express (CPX) board
USB cable
Computer with Mu Editor
Servo Control Using CPX Toggle Switch
Click here
to view the connection diagram for a servo motor and CPX
Click here
to view the instructions and code
Using Try-Except block in CircuitPython
Handling Servo Motor Errors Using Try-Except in CircuitPython
Sample code:
Click here to view the instructions and code (without try-except)How to fix the error:
Click here to view the instructions and code (with try-except)Here is the solution:
Click here to see the solution video for Exercise 1servo.angle command.
View the code here
Is it better to prevent errors or handle them when they happen?